/// 推荐项目的数据模型
class Recommendation {
  final String posterUrl; // 海报图片URL
  final String title; // 标题
  final String status; // 状态，如 "已完结", "更新至第10集"

  Recommendation({
    required this.posterUrl,
    required this.title,
    required this.status,
  });
}

/// 影片详情主数据模型
class Film {
  final int? vodId;
  final String? vodName;
  final String? vodClass;
  final String? vodPicThumb;
  final String? vodPic;
  final String? vodActor;
  final String? vodDirector;
  final String? vodRemarks;
  final String? vodWeekday;
  final String? vodArea;
  final String? vodLang;
  final String? vodYear;
  final int? vodHits;
  final String? vodContent;
  final String? vodPlayFrom;
  final String? vodPlayUrl;

  Film({
    this.vodId,
    this.vodName,
    this.vodClass,
    this.vodPicThumb,
    this.vodPic,
    this.vodActor,
    this.vodDirector,
    this.vodRemarks,
    this.vodWeekday,
    this.vodArea,
    this.vodLang,
    this.vodYear,
    this.vodHits,
    this.vodContent,
    this.vodPlayFrom,
    this.vodPlayUrl,
  });

  factory Film.fromJson(Map<String, dynamic> json) {
    return Film(
      vodId: json['vod_id'] as int? ?? 0,
      vodName: json['vod_name'] as String? ?? '',
      vodClass: json['vod_class'] as String? ?? '',
      vodPicThumb: json['vod_pic_thumb'] ?? '',
      vodPic: json['vod_pic'] as String? ?? '',
      vodActor: json['vod_actor'] as String? ?? '',
      vodDirector: json['vod_director'] as String? ?? '',
      vodRemarks: json['vod_remarks'] as String? ?? '',
      vodWeekday: json['vod_weekday'] as String? ?? '',
      vodArea: json['vod_area'] as String? ?? '',
      vodLang: json['vod_lang'] as String? ?? '',
      vodYear: json['vod_year'] as String? ?? '',
      vodHits: json['vod_hits'] as int? ?? 0,
      vodContent: json['vod_content'] as String? ?? '',
      vodPlayFrom: json['vod_play_from'] as String? ?? '',
      vodPlayUrl: json['vod_play_url'] as String? ?? '',
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'vod_id': vodId,
      'vod_name': vodName,
      'vod_class': vodClass,
      'vod_pic': vodPic,
      'vod_actor': vodActor,
      'vod_director': vodDirector,
      'vod_remarks': vodRemarks,
      'vod_weekday': vodWeekday,
      'vod_area': vodArea,
      'vod_lang': vodLang,
      'vod_year': vodYear,
      'vod_hits': vodHits,
      'vod_content': vodContent,
      'vod_play_from': vodPlayFrom,
      'vod_play_url': vodPlayUrl,
    };
  }
}

class VideoItem {
  final String code;
  final String name;

  VideoItem({
    required this.code,
    required this.name,
  });
}
